﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HenIT.BizTalk.Objects
{
    public class StringMatch : IComparable
    {
        public bool Match { get; set; }
        private string name = "";
        public string Name {
            get { return name; }
            set
            {
                name = value;
                Match = name == name2;
            }
        }
        private string name2 = "";
        public string Name2 
        {
            get { return name2; }
            set
            {
                name2 = value;
                Match = name == name2;
            }
        }

        public StringMatch(string name)
        {
            Name = name;
        }

        public override string ToString()
        {
            return Name;
        }

        #region IComparable Members
        public int CompareTo(object obj)
        {
            return CompareTo((StringMatch)obj);
        }
        public int CompareTo(StringMatch obj)
        {
            return Name.CompareTo(obj.Name);
        }
        #endregion
    }
}
